<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateUserTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreateUserLabel_username}" for="username" />
                    <h:inputText id="username" value="#{userController.selected.username}" title="#{bundle.CreateUserTitle_username}" required="true" requiredMessage="#{bundle.CreateUserRequiredMessage_username}"/>
                    <h:outputLabel value="#{bundle.CreateUserLabel_password}" for="password" />
                    <h:inputText id="password" value="#{userController.selected.password}" title="#{bundle.CreateUserTitle_password}" required="true" requiredMessage="#{bundle.CreateUserRequiredMessage_password}"/>
                    <h:outputLabel value="#{bundle.CreateUserLabel_userGroup}" for="userGroup" />
                    <h:inputText id="userGroup" value="#{userController.selected.userGroup}" title="#{bundle.CreateUserTitle_userGroup}" />
                    <h:outputLabel value="#{bundle.CreateUserLabel_email}" for="email" />
                    <h:inputText id="email" value="#{userController.selected.email}" title="#{bundle.CreateUserTitle_email}" required="true" requiredMessage="#{bundle.CreateUserRequiredMessage_email}"/>
                    <h:outputLabel value="#{bundle.CreateUserLabel_client}" for="client" />
                    <h:selectOneMenu id="client" value="#{userController.selected.client}" title="#{bundle.CreateUserTitle_client}" >
                        <f:selectItems value="#{clientController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.CreateUserLabel_owner}" for="owner" />
                    <h:selectOneMenu id="owner" value="#{userController.selected.owner}" title="#{bundle.CreateUserTitle_owner}" >
                        <f:selectItems value="#{ownerController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.CreateUserLabel_agent}" for="agent" />
                    <h:selectOneMenu id="agent" value="#{userController.selected.agent}" title="#{bundle.CreateUserTitle_agent}" >
                        <f:selectItems value="#{agentController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <br />
                <h:commandLink action="#{userController.create}" value="#{bundle.CreateUserSaveLink}" />
                <br />
                <br />
                <h:commandLink action="#{userController.prepareList}" value="#{bundle.CreateUserShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.CreateUserIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
